<template>
	<view>
		<view class="integral-log-header">
			<!-- <image class="bg" :src="statics.moneyRecharge"></image> -->
			<view class="main pd24_20" style="padding: 20rpx;">
				<view class="flex alcenter space card">
					<view>
						<view class="flex alcenter">
							<text class="ft14 ">{{$t('My earnings')}}</text>
						</view>
						<view class="mt16 flex alcenter">
							<image :src="statics.integralImg01" style="width: 40rpx; height: 40rpx;"></image>
							<text class="ml10 ft20  ftw600">${{urerdata.money}}</text>
						</view>
					</view>
					<image src="@/static/jinbi.png" style="width:200rpx;" mode="widthFix"></image>
					<!-- 		<navigator open-type="redirect" url="txjl">
						<view class="btn-integral">{{$t('cash.records')}}</view>
					</navigator> -->

				</view>
			</view>
		</view>
		<view class="integral-log-main pd16_15">
			<view class="ft16">{{$t('cash.method')}} > {{type}}</view>
			<view class="ft14 mt20">{{$t('cash.money')}}</view>
			<input type="digit" class="inbox mt16" v-model="money" :placeholder="$t('cash.input.money')" />
			<view class="ft14 mt20">{{$t('cash.realname')}}</view>
			<input type="text" class="inbox mt16" v-model="name" :placeholder="$t('cash.input.realname')" />
			<view class="ft14 mt20">{{$t('cash.account')}}</view>
			<input type="text" class="inbox mt16" v-model="cord" :placeholder="$t('cash.input.account')" />

			<view class="ft14 mt16" style="color: #FF6C00;">{{$t('cash.beizhu')}}</view>

			<button @click="butsub()" class="ft18 mt20 subbtn">{{$t('Submit')}}</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				loading: false,
				money: '',
				name: '',
				cord: '',
				type: 'Paypal',
				urerdata: [],
				configsa: []
			}
		},
		onLoad: function() {

		},
		onShow() {
			uni.setNavigationBarTitle({
				title: this.$t('Withdrawal')
			});
			this.ongrzlTap()
		},
		onNavigationBarButtonTap(e) {
			uni.navigateTo({
				url: '/pages/fenxiao/txjl'
			})
		},
		methods: {
			async butsub() {
				var thia = this
				let data = {
					'token': uni.getStorageSync("userinfo").token,
					'money': this.money,
					'name': this.name,
					'cord': this.cord,
					'type': this.type,
				};
				let [err, res] = await this.$httpas.get('/api/user/tx', data);
				if (!this.$httpas.errorCheck(err, res)) return;
				uni.showModal({
					title: this.$t('Warning'),
					content: res.data.msg,
					showCancel: false,
					success: ress => {
						if (res.data.code == 1) {
							thia.money = ''
							thia.name = ''
							thia.cord = ''
						}
						thia.ongrzlTap()
					}
				});
			},
			async ongrzlTap() {
				let data = {};
				data.token = uni.getStorageSync("userinfo").token;
				data.uid = uni.getStorageSync("userinfo").id;
				let [err, res] = await this.$httpas.get('/api/user/index', data);
				if (res.data.code == 1) {
					this.urerdata = res.data.data
					if (res.data.data.config) {
						this.configsa = res.data.data.config
					}
				} else {
					uni.showToast({
						title: res.data.msg,
						icon: "none"
					});
				}
			}
		}
	}
</script>
<style lang="scss" scoped>
	.main {

		.card {
			color: #563010;
			border-radius: 20rpx;
			padding: 5rpx 50rpx;
			background: linear-gradient(270deg, #FAC250 0%, #FDDE76 100%);
		}
	}

	.integral-log-main {
		margin-top: 26rpx;
	}
</style>
<style>
	.integral-log-header {
		position: relative;
		height: 252rpx;
	}

	.integral-log-header .bg {
		width: 100%;
		height: 252rpx;
	}

	.integral-log-header .main {
		width: 100%;
		/* position: absolute; */
		left: 0;
		top: 0;
	}

	.btn-integral {
		width: 192rpx;
		height: 80rpx;
		background: #FFFFFF;
		box-shadow: 0rpx 8rpx 32rpx 0rpx rgba(0, 0, 0, 0.04);
		border-radius: 40rpx;
		text-align: center;
		line-height: 80rpx;
		font-size: 28rpx;
		font-weight: 500;
	}

	.integral-log-main {
		background: #FFFFFF;
		min-height: 800rpx;
		/* margin-top: 26rpx; */
		/* position: relative; */
		/* margin-top: -32rpx; */
		border-radius: 32rpx 32rpx 0rpx 0rpx;
	}

	.inbox {
		border: solid 1px #cccccc;
		padding: 10rpx;
	}

	.subbtn {
		width: 80%;
		background: linear-gradient(270deg, #FAC250 0%, #FDDE76 100%);
		color: #563010;
		box-shadow: 0px 4px 10px 0px rgba(246, 157, 57, 0.3);
		color: #ffffff;
		text-align: center;
		height: 100upx;
		line-height: 100upx;
	}
</style>